Living body detection method, living body detection system, and computer program product

ABSTRACT

The present invention relates to a living body detection method and living body detection system capable of realizing living body detection of a human body, and a computer program product. The living body detection method comprises: respectively using each light source of at least two light sources arranged at different positions to illuminate a face of an object to be detected; capturing a plurality of images of the face of the object to be detected that is illuminated by each light source; calculating a difference image between the plurality of images; and obtaining a detection value of the difference image, and determining that the object to be detected is a living body if the detection value is greater than a pre-determined threshold value.

TECHNICAL FIELD

The present disclosure relates to the field of living body detection,and more particularly, to a living body detection method, a living bodydetection system, and a computer program product, which are capable ofimplementing living body detection on a human body.

BACKGROUND

At present, face recognition systems are more and more applied toscenarios that require an ID authentication in fields like security,finance etc., such as remote bank account opening, access controlsystem, remote transaction operating verification etc. In theseapplication fields with high security level, in addition to ensuringthat a face similarity of an authenticatee matches with library datastored in a database, first, it needs that the authenticatee is alegitimate biological living body. That is to say, the face recognitionsystem needs to be able to prevent an attacker from attacking usingpictures, 3D face models, or masks and so on.

The method for solving the above problem is usually called living bodydetection, which aims to determine whether an obtained physiologicalfeature comes from a living, in-field, real person. Living bodyverification schemes acknowledged as mature do not exist amongtechnology products on market, and the conventional living bodydetection techniques either depend on specific hardware devices (such asinfrared came, depth camera) or can prevent only simple attacks fromstatic pictures. In addition, most of the living body detection systemsexisting in the prior art are cooperated-style, i.e., requiring a personbeing tested to make a corresponding action or stay fixed in place for aperiod of time according to an instruction from the systems, so it willaffect user experience and efficiency of living body detection. Besides,for example, the accuracy and robustness of other methods by determiningwhether there is an image border in a detected image can hardly meet theactual demands.

SUMMARY

In view of the above problem, the present disclosure is proposed. Thepresent disclosure provides a living body detection method, a livingbody detection system, and a computer program product, wherein face ofthe person being tested is irradiated by two or more light sourcessequentially, differences of obtained images are compared, and then itis determined whether there is a match with features of a human face.Since there are prominent facial features (e.g., nose, mouth, chin,etc.) on the human face, but pictures, screens or the like are flat, thehuman faces can be effectively distinguished from photos and videoattackers. A non-cooperated-style living body detection is achieved, anormal user can be effectively distinguished from photo, video, maskattacker, without requiring the user's special cooperation, the securityand ease-of-use of the living body detection system are increased.

According to an embodiment of the present disclosure, there is provideda living body detection method, comprising: irradiating a face of anobject to be detected using each of at least two light sources arrangedin different positions, respectively; capturing a plurality of images ofthe face of the object to be detected when being irradiated by each ofthe light sources; calculating a difference image between the pluralityof images; and obtaining a detection value of the difference image, anddetermining that the object to be detected is a living body when thedetection value is larger than a predetermined threshold.

In addition, in the living body detection method according to anembodiment of the present disclosure, obtaining a detection value of thedifference image, and determining that the object to be detected is aliving body when the detection value is larger than a predeterminedthreshold comprises: determining a facial region from among theplurality of images based on a first image or a second image; extractinga value of the difference image corresponding to the facial region as animage to be detected; obtaining the detection value based on the imageto be detected; and comparing the detection value with the predeterminedthreshold, and determining that the object to be detected is a livingbody when the detection value is larger than the predeterminedthreshold.

In addition, in the living body detection method according to anembodiment of the present disclosure, obtaining the detection valuebased on the image to be detected comprises: inputting the image to bedetected into a pre-trained image classifier, generating and outputting,by the image classifier, the detection value corresponding to the imageto be detected.

In addition, in the living body detection method according to anembodiment of the present disclosure, the at least two light sources area first light source and a second light source, the plurality of imagesare a first image when being irradiated by the first light source and asecond image when being irradiated by the second light source, a firstpixel value of the first image at a pixel dot (x,y) is I1 (x,y), and asecond pixel value of the second image at a pixel dot (x,y) is I2 (x,y),and calculating a difference image between the plurality of imagescomprises: calculating a difference image J(x,y) of the first image andthe second image at a pixel dot (x,y),J(x,y)=[I1(x,y)−I2(x,y)]/[I1(x,y)+I2(x,y)+eps], wherein eps is anon-zero constant.

In addition, in the living body detection method according to anembodiment of the present disclosure, the at least two light sources area first light source and a second light source, the plurality of imagesare a first image when being irradiated by the first light source, asecond image when being irradiated by the second light source, and athird image when not being irradiated by any of the at least two lightsources, a first pixel value of the first image at a pixel dot (x,y) isI1 (x,y), a second pixel value of the second image at a pixel dot (x,y)is I2 (x,y), and a third pixel value of the third image at a pixel dot(x,y) is I3(x,y), calculating a difference image between the pluralityof images comprises: calculating a difference image J(x,y) of the firstimage, the second image, and the third image at a pixel dot (x,y),J(x,y)=[I1(x,y)−I2(x,y)]/[I1(x,y)+I2(x,y)−I3(x,y)×2+eps], wherein eps isa non-zero constant.

In addition, in the living body detection method according to anembodiment of the present disclosure, the at least two light sources area first light source and a second light source, the plurality of imagesare a first image when being irradiated by the first light source and asecond image when being irradiated by the second light source, a firstpixel value of the first image at a pixel dot (x,y) is I1 (x,y), and asecond pixel value of the second image at a pixel dot (x,y) is I2 (x,y),and calculating a difference image between the plurality of imagescomprises: calculating a difference image J(x,y) of the first image andthe second image at a pixel dot (x,y),J(x,y)=[I1(x,y)/A(x,y)−I2(x,y)/B(x,y)]/[I1(x,y)/A(x,y)+I2(x,y)/B(x,y)+eps],wherein eps is a non-zero constant, A(x,y) and B(x,y) are pre-setcompensation images.

In addition, in the living body detection method according to anembodiment of the present disclosure, the at least two light sources area first light source and a second light source, the plurality of imagesare a first image when being irradiated by the first light source, asecond image when being irradiated by the second light source, and athird image when not being irradiated by any of the at least two lightsources, a first pixel value of the first image at a pixel dot (x,y) isI1 (x,y), a second pixel value of the second image at a pixel dot (x,y)is I2 (x,y), and a third pixel value of the third image at a pixel dot(x,y) is I3(x,y), calculating a difference image between the pluralityof images comprises: calculating a difference image J(x,y) of the firstimage, the second image, and the third image at a pixel dot (x,y),J(x,y)=[(I1(x,y)−I3(x,y))/A(x,y)−I2(x,y)−I3(x,y))/B(x,y)]/[(I1(x,y)−I3(x,y))/A(x,y)+(I2(x,y)−I3(x,y))/B(x,y)+eps], wherein eps is a non-zeroconstant, A(x,y) and B(x,y) are pre-set compensation images.

According to another embodiment of the present disclosure, there isprovided a living body detection system, comprising: a light sourcemodule including at least two light sources arranged in differentpositions, a face of an object to be detected being illuminated by eachof the at least two light sources, respectively; an image capturingmodule for capturing a plurality of images of the face of the object tobe detected when being irradiated by each of the light sources; a livingbody detection module for determining whether the object to be detectedis a living body, wherein the method of determining whether the objectto be detected is living comprises: calculating a difference imagebetween the plurality of images; and obtaining a detection value of thedifference image, and determining that the object to be detected is aliving body when the detection value is larger than a predeterminedthreshold.

In addition, in the living body detection system according to anotherembodiment of the present disclosure, the living body detection moduledetermines a facial region from among the plurality of images based on afirst image or a second image, extracts a value of the difference imagecorresponding to the facial region as an image to be detected, obtainsthe detection value based on the image to be detected, compares thedetection value with the predetermined threshold, and determines thatthe object to be detected is a living body when the detection value islarger than the predetermined threshold.

In addition, in the living body detection system according to anotherembodiment of the present disclosure, the living body detection modulefurther comprises a pre-trained image classifier that generates andoutputs the detection value corresponding to the image to be detected.

In addition, in the living body detection system according to anotherembodiment of the present disclosure, the at least two light sources area first light source and a second light source, the plurality of imagesare a first image when being irradiated by the first light source and asecond image when being irradiated by the second light source, a firstpixel value of the first image at a pixel dot (x,y) is I1 (x,y), and asecond pixel value of the second image at a pixel dot (x,y) is I2 (x,y),the living body detection module calculates a difference image J(x,y) ofthe first image and the second image at a pixel dot (x,y),J(x,y)=[(x,y)−I2(x,y)]/[(x,y)+I2(x,y)+eps], wherein eps is a non-zeroconstant.

In addition, in the living body detection system according to anotherembodiment of the present disclosure, the at least two light sources area first light source and a second light source, the plurality of imagesare a first image when being irradiated by the first light source, asecond image when being irradiated by the second light source, and athird image when not being irradiated by any of the at least two lightsources, a first pixel value of the first image at a pixel dot (x,y) isI1 (x,y), a second pixel value of the second image at a pixel dot (x,y)is I2 (x,y), and a third pixel value of the third image at a pixel dot(x,y) is I3(x,y), the living body detection module calculates adifference image J(x,y) of the first image, the second image, and thethird image at a pixel dot (x,y),J(x,y)=[I1(x,y)−I2(x,y)]/[I1(x,y)+I2(x,y)−I3(x,y)×2+eps], wherein eps isa non-zero constant.

In addition, in the living body detection system according to anotherembodiment of the present disclosure, the at least two light sources area first light source and a second light source, the plurality of imagesare a first image when being irradiated by the first light source and asecond image when being irradiated by the second light source, a firstpixel value of the first image at a pixel dot (x,y) is I1 (x,y), and asecond pixel value of the second image at a pixel dot (x,y) is I2 (x,y),the living body detection module calculates a difference image J(x,y) ofthe first image and the second image at a pixel dot (x,y),J(x,y)=[I1(x,y)/A(x,y)−I2(x,y)/B(x,y)]/[I1(x,y)/A(x,y)+I2(x,y)/B(x,y)+eps],wherein eps is a non-zero constant, A(x,y) and B(x,y) are pre-setcompensation images.

In addition, in the living body detection system according to anotherembodiment of the present disclosure, the at least two light sources area first light source and a second light source, the plurality of imagesare a first image when being irradiated by the first light source, asecond image when being irradiated by the second light source, and athird image when not being irradiated by any of the at least two lightsources, a first pixel value of the first image at a pixel dot (x,y) isI1 (x,y), a second pixel value of the second image at a pixel dot (x,y)is I2 (x,y), and a third pixel value of the third image at a pixel dot(x,y) is I3(x,y), the living body detection module calculates adifference image J(x,y) of the first image, the second image, and thethird image at a pixel dot (x,y), J(x,y)=[(I1(x,y)−I3(x,y))/A(x,y)−I2(x,y)−I3(x,y))/B(x,y)]/[(I1(x,y)−I3(x,y))/A(x,y)+(I2(x,y)−I3(x,y))/B(x,y)+eps],wherein eps is a non-zero constant, A(x,y) and B(x,y) are pre-setcompensation images.

In addition, in the living body detection system according to anotherembodiment of the present disclosure, the at least two light sources areprogrammable controlled light sources disposed at periphery of the imagecapturing module and integrally constructed together with the imagecapturing module.

In addition, in the living body detection system according to anotherembodiment of the present disclosure, the at least two light sources aredisposed symmetrically with respect to the image capturing module.

According to yet another embodiment of the present disclosure, there isprovided a computer program product, comprising a non-transitorycomputer-readable medium on which computer program instructionsconfigured to execute the following steps when being run by a computerare stored: capturing a plurality of images of a face of an object to bedetected when being irradiated by each of at least two light sourcesarranged in different positions; calculating a difference image betweenthe plurality of images; and obtaining a detection value of thedifference image, and determining that the object to be detected is aliving body when the detection value is larger than a predeterminedthreshold.

It is to be understood that both the foregoing general descriptions andthe following detailed descriptions are exemplary and intended toprovide further explanations of the claimed technique.

BRIEF DESCRIPTION OF THE DRAWINGS

Through the more detailed description of embodiments of the presentdisclosure with reference to the accompanying drawings, the above andother objectives, features, and advantages of the present disclosurewill become more apparent. The drawings are to provide furtherunderstanding for the embodiments of the present disclosure andconstitute a portion of the specification, and are intended to interpretthe present disclosure together with the embodiments rather than tolimit the present disclosure. In the drawings, the same reference signgenerally refers to the same component or step.

FIG. 1 is a flowchart illustrating a living body detection methodaccording to an embodiment of the present disclosure.

FIG. 2 is a functional block diagram illustrating a living bodydetection system according to an embodiment of the present disclosure.

FIG. 3 is a schematic diagram further illustrating a living bodydetection system according to an embodiment of the present disclosure.

FIG. 4 is a flowchart further illustrating acquisition of the differenceimage to be detected in a first example according to an embodiment ofthe present disclosure.

FIG. 5 is a schematic diagram further illustrating acquisition of thedifference image to be detected in a second example according to anembodiment of the present disclosure.

FIG. 6 is a flowchart further illustrating a living body detection basedon the difference image to be detected according to an embodiment of thepresent disclosure.

FIG. 7 is a schematic block diagram illustrating a living body detectionsystem according to an embodiment of the present disclosure.

DETAILED DESCRIPTION OF THE EMBODIMENTS

To make the objectives, technical solutions, and advantages of thepresent disclosure more clear, exemplary embodiments of the presentdisclosure will be described in detail with reference to theaccompanying drawings. Obviously, the described embodiments merely areonly part of the embodiments of the present disclosure, rather than allof the embodiments of the present disclosure, it should be understoodthat the present disclosure is not limited to the exemplary embodimentsdescribed herein. All other embodiments obtained by those skilled in theart without paying inventive efforts should all fall into the protectionscope of the present disclosure.

Hereinafter, preferred embodiments of the present disclosure will bedescribed in detail with reference to the accompanying drawings.

FIG. 1 is a flowchart illustrating a living body detection methodaccording to an embodiment of the present disclosure. As shown in FIG.1, the living body detection method according to an embodiment of thepresent disclosure comprises the following steps.

In step S101, a face of an object to be detected is illuminated usingeach of at least two light sources arranged in different positions,respectively. As will be described in detail below, in an embodiment ofthe present disclosure, the at least two light sources may beprogrammable controlled LED light sources that emit infrared or visiblelight. A first light source of the at least two light sources may beprogrammable controlled to be turned on and a second light sourcethereof to be turned off, so as to illuminate the face of the object tobe detected; afterwards, the second light source thereof is controlledto be turned on and the first light source thereof is controlled to beturned off, so as to illuminate the face of the object to be detected.Thereafter, the processing advances to step S102.

In step S102, a plurality of images of the face of the object to bedetected when being irradiated by each of the light sources arecaptured. As will be appreciated, steps S101 and S102 may be performedin synchronization, that is, a first image is captured when the firstlight source of the at least two light sources is turned on and thesecond light source thereof is turned off to illuminate the face of theobject to be detected; afterwards, a second image is captured when thesecond light source of the at least two light sources is turned on andthe first light source thereof is turned off to irradiate the face ofthe object to be detected. Thereafter, the processing advances to stepS103.

In step S103, a difference image between the plurality of images iscalculated. In an embodiment of the present disclosure, a differenceimage between the first image and the second image obtained in step S102may be directly calculated. In another embodiment of the presentdisclosure, a difference image between the first image and the secondimage obtained in step S102 and a third image captured withoutirradiating of any light source is calculated. Further, in still anotherembodiment of the present disclosure, when a difference image betweenthe first image and the second image is calculated or a difference imagebetween the first image, the second image, and the third image iscalculated, preset compensation images compensating for deviation causedby brightness of the light sources, distance from the object to bedetected, and so on. The specific description will be provided below incombination with the drawings. Thereafter, the processing advances tostep S104.

In step S104, a detection value of the difference image is obtained. Inan embodiment of the present disclosure, a value corresponding to thefacial region in the difference image as calculated in the above stepS103 is extracted and scaled to a fixed size as the image to bedetected. After that, the image to be detected is inputted to apre-trained image classifier, the image classifier generates and outputsthe detection value corresponding to the image to be detected. In anembodiment of the present disclosure, the image classifier may be apre-trained convolutional neural network (CNN). Thereafter, theprocessing advances to step S105.

In step S105, it is determined whether the detection value of thedifference image as obtained in step S104 is larger than a predeterminedthreshold. The predetermined threshold is a value determined and set inadvance using statistical learning methods such as deep learning,support vector machine, and the like, while taking a large number offace images as positive samples and photos, video playbacks, papermasks, and 3D model images as negative samples. In an embodiment of thepresent disclosure, the predetermined threshold may be set as 0.5.

If a positive result is obtained in step S105, that is, the detectionvalue is larger than the predetermined threshold, the processingadvances to step S106. In step S106, it is determined that the object tobe detected is a living body.

Contrarily, if a negative result is obtained in step S105, that is, thedetection value is not larger than the predetermined threshold, theprocessing advances to step S107. In step S107, it is determined thatthe object to be detected is a non-living body.

In the living body detection method according to an embodiment of thepresent disclosure as described above, based on that there are prominentfacial features (e.g., nose, mouth, chin, etc.) on human face, the imagedifference due to the unique shape of human face is captured underirradiation of different light sources, but pictures, video on screensand other plane attackers cannot produce the corresponding imagedifference, a normal user can be effectively distinguished from photo,video, mask attacker, without requiring the user's special cooperation,security and ease-of-use of the living body detection system areincreased.

Hereinafter, the living body detection system that executes theabove-described living body detection method will be further describedwith reference to FIG. 2.

FIG. 2 is a functional block diagram illustrating a living bodydetection system according to an embodiment of the present disclosure.As shown in FIG. 2, the living body detection system 20 according to anembodiment of the present disclosure comprises a light source module 21,an image capturing module 22, and a living body detection module 23. Thelight source module 21, the image capturing module 22, and the livingbody detection module 23 may be configured by, for example, hardware,software, firmware, and any feasible combinations thereof.

Specifically, the light source module 21 includes at least two lightsources arranged in different positions, a face of an object to bedetected is illuminated by each of the at least two light sources,respectively. The at least two light sources may be programmablecontrolled LED light sources that emit infrared or visible light. Afirst light source of the at least two light sources may be programmablecontrolled to be turned on and the second light source to be turned off,so as to illuminate the face of the object to be detected; afterwards,the second light source of the at least two light sources is controlledto be turned on and the first light source thereof is controlled to beturned off to illuminate the face of the object to be detected.

The image capturing module 22 is for capturing a plurality of images ofthe face of the object to be detected when being irradiated by each ofthe light sources. When the first light source of the at least two lightsources is turned on and the second light source thereof is turned offto illuminate the face of the object to be detected, a first image iscaptured; afterwards, when the second light source of the at least twolight sources is turned on and the first light source thereof is turnedoff to irradiate the face of the object to be detected, a second imageis captured. In addition, when the at least two light sources are bothturned off, the image capturing module 22 may capture a third image.

In an embodiment of the present disclosure, the light source module 21is disposed at periphery of the image capturing module 22 and integrallyconstructed together with the image capturing module 22. The imagecapturing module 22 may be physically separated from the subsequentliving body detection module 23 or may be physically located in the sameplace or even within the same housing together with the subsequentliving body detection module 23. In the case where the image capturingmodule 22 is physically separated from the subsequent living bodydetection module 23, the image capturing module 22 further transmits, ina wired or wireless manner, an acquired image of the face of the objectto be detected to the living body detection module 23 as providedsubsequently. In the case where the image capturing module 22 and thesubsequent living body detection module 23 are physically located at thesame position or even inside the same housing, the image capturingmodule 22 transmits the image of the face of the object to be detectedto the living body detection module 23 via an internal bus. Prior totransmitting the video data in a wired or wireless manner or via a bus,it is possible to encode the video data with a predetermined format andcompress it as a video packet, so as to reduce traffic and bandwidththat are required by the transmission.

The living body detection module 23 is for determining whether theobject to be detected is a living body. Specifically, the living bodydetection module 23 calculates a difference image between the pluralityof images as captured by the image capturing module 22, obtains adetection value of the difference image, and determines that the objectto be detected is a living body if the detection value is larger than apredetermined threshold. Exemplarily, the living body detection module23 may be implemented by hardware such as a processor, or by a computerand software running on the computer.

The living body detection method and the living body detection systemaccording to the embodiments of the present disclosure have beendescribed above with reference to FIGS. 1 and 2. Hereinafter, the firstto second exemplary living body detection method and living bodydetection system according to the embodiments of the present disclosurewill be further described with reference to FIGS. 3 to 6.

FIG. 3 is a schematic diagram further illustrating a living bodydetection system according to an embodiment of the present disclosure.As shown in FIG. 3, positions of the living body detection system 20 andthe object 30 to be detected are relatively fixed. For example, theliving body detection system 20 shown in FIG. 3 is a face card readerwith a short working distance. The light source module 21, the imagecapturing module 22, and the living body detection module 23 areincluded in the living body detection system 20. Specifically, the lightsource module 21 in the living body detection system 20 shown in FIG. 3includes a first light source 301 and a second light source 302. Thefirst light source 301 and the second light source 302 may be controlledto be turned on to irradiate the face of the object 30 to be detected,respectively. As shown in FIG. 3, the first light source 301 and thesecond light source 302 may be disposed at periphery of the imagecapturing module 22 and integrally constructed together with the imagecapturing module 22. Further, in a preferred embodiment of the presentinvention, the first light source 301 and the second light source 302are symmetrically disposed with respect to the image capturing module22. The first light source 301 and the second light source 302 emitirradiation light to irradiate the face of the object to be detected,for example, irradiating lips, cheeks, nose, and the like. The imagecapturing module 22 shown captures an image of the face of the object tobe detected as illuminated by the first light source 301 and the secondlight source 302. The living body detection module 23 shown determineswhether the object to be detected is a living body.

FIG. 4 is a flowchart further illustrating acquisition of the differenceimage to be detected in a first example according to an embodiment ofthe present disclosure. acquisition of the difference image to bedetected in a first example according to an embodiment of the presentdisclosure comprises the following steps.

In step S401, the first light source 301 is turned on. Thereafter, theprocessing advances to step S402.

In step S402, a first image of the object to be detected when beingirradiated by the first light source 301 is captured. In an embodimentof the present disclosure, a first pixel value of the first image at apixel dot (x,y) is I1 (x,y). Thereafter, the processing advances to stepS403.

In step S403, the first light source 301 is turned off, the second lightsource 302 is turned on. Thereafter, the processing advances to stepS404.

In step S404, a second image of the object to be detected when beingirradiated by the second light source 302 is captured. In an embodimentof the present disclosure, a second pixel value of the second image at apixel dot (x,y) is I2 (x,y). Thereafter, the processing advances to stepS405.

In step S405, a difference image is calculated based on the first imageand the second image. In an embodiment of the present disclosure, adifference image J(x,y) of the first image and the second image at apixel dot (x,y) is calculated by using Expression (1):J(x,y)=[I1(x,y)−I2(x,y)]/[I1(x,y)+I2(x,y)+eps]  (1)

wherein eps is a non-zero constant to avoid the case where thedenominator in Expression (1) is zero.

In another embodiment of the present disclosure, a difference imageJ(x,y) of the first image and the second image at a pixel dot (x,y) iscalculated by using Expression (2):J(x,y)=[I1(x,y)/A(x,y)−I2(x,y)/B(x,y)]/[I1(x,y)/A(x,y)+I2(x,y)/B(x,y)+eps]  (2)

wherein eps is a non-zero constant, A(x,y) and B(x,y) are pre-setcompensation images, the compensation images are compensating fordeviation caused by brightness of the light sources, distance from theobject to be detected, and so on.

The difference image J(x,y) acquired via the above steps S401 to S405 issupplied to the living body detection module 23 to carry out living bodydetection.

FIG. 5 is a schematic diagram further illustrating acquisition of thedifference image to be detected in a second example according to anembodiment of the present disclosure. Acquisition of the differenceimage to be detected in a second example according to an embodiment ofthe present disclosure comprises the following steps.

In step S501, the first light source 301 is turned on. Thereafter, theprocessing advances to step S502.

In step S502, a first image of the object to be detected when beingirradiated by the first light source 301 is captured. In an embodimentof the present disclosure, a first pixel value of the first image at apixel dot (x,y) is I1 (x,y). Thereafter, the processing advances to stepS503.

In step S503, the first light source 301 is turned off, the second lightsource 302 is turned on. Thereafter, the processing advances to stepS504.

In step S504, a second image of the object to be detected when beingirradiated by the second light source 302 is captured. In an embodimentof the present disclosure, a second pixel value of the second image at apixel dot (x,y) is I2 (x,y). Thereafter, the processing advances to stepS505.

In step S505, the first light source 301 and the second light source 302are both turned off. Thereafter, the processing advances to step S506.

In step S506, a third image of the object to be detected when not beingirradiated by any light source is captured. In an embodiment of thepresent disclosure, a third pixel value of the third image at a pixeldot (x,y) is I3(x,y), Thereafter, the processing advances to step S507.

In step S507, a difference image is calculated based on the first image,the second image, and the third image.

In an embodiment of the present disclosure, a difference image J(x,y) ofthe first image, the second image, and the third image at a pixel dot(x,y) is calculation by using Expression (3):J(x,y)=[I1(x,y)−I2(x,y)]/[(x,y)+I2(x,y)−I3(x,y)×2+eps]  (3)

wherein eps is a non-zero constant to avoid the case where thedenominator in Expression (3) is zero.

In another embodiment of the present disclosure, a difference imageJ(x,y) of the first image, the second image, and the third image at apixel dot (x,y) is calculated by using Expression (4):J(x,y)=[(I1(x,y)−I3(x,y))/A(x,y)−I2(x,y)−I3(x,y))/B(x,y)]/[(I1(x,y)−I3(x,y))/A(x,y)+(I2(x,y)−I3(x,y))/B(x,y)+eps]  (4)

wherein eps is a non-zero constant, A(x,y) and B(x,y) are pre-setcompensation images, the compensation images are compensating fordeviation caused by brightness of the light sources, distance from theobject to be detected, and so on.

The difference image J(x,y) acquired via the above steps S501 to S507 issupplied to the living body detection module 23 to carry out living bodydetection.

FIG. 6 is a flowchart further illustrating a living body detectionmethod based on the difference image to be detected according to anembodiment of the present disclosure. After the image to be detected isacquired through the first example shown in FIG. 4 or the second exampleshown in FIG. 5, the living body detection module 23 performs livingbody detection based on the image to be detected. The process ofperforming living body detection based on the image to be detectedcomprises the following steps.

In step S601, a facial region is determined from among the plurality ofimages based on a first image or a second image. For example, apre-trained face detector (such as Haar Cascade) is used to obtain thefacial region. Thereafter, the processing advances to step S602.

In step S602, a value of the difference image corresponding to thefacial region is extracted as an image to be detected. In an embodimentof the present disclosure, a value corresponding to the facial region inthe difference image J(x,y) is extracted and scaled to a fixed size asthe image to be detected. Thereafter, the processing advances to stepS603.

In step S603, the detection value is obtained based on the image to bedetected. In an embodiment of the present disclosure, the image to bedetected is inputted to a pre-trained image classifier, the imageclassifier generates and outputs the detection value corresponding tothe image to be detected. In an embodiment of the present disclosure,the image classifier may be a pre-trained convolutional neural network(CNN). Thereafter, the processing advances to step S604.

In step S604, it is determined whether the detection value is largerthan a predetermined threshold. The predetermined threshold is a valuedetermined and set in advance using statistical learning methods such asdeep learning, support vector machine, and the like, while taking alarge number of face images as positive samples and taking photos, videoplaybacks, paper masks, and 3D model images as negative samples. In anembodiment of the present disclosure, the predetermined threshold may beset as 0.5.

If a positive result is obtained in step S604, that is, the detectionvalue is larger than the predetermined threshold, the processingadvances to step S605. In step S605, it is determined that the object tobe detected is a living body.

Contrarily, if a negative result is obtained in step S604, that is, thedetection value is not larger than the predetermined threshold, theprocessing advances to step S604. In step S604, it is determined thatthe object to be detected is a non-living body.

FIG. 7 is a schematic block diagram illustrating a living body detectionsystem according to an embodiment of the present disclosure. As shown inFIG. 7, the living body detection system 7 according to an embodiment ofthe present disclosure comprises a processor 71, a memory 72, andcomputer program instructions 73 stored in the memory 72.

The computer program instructions 73 can achieve functions of respectivefunctional modules of the living body detection system according to anembodiment of the present disclosure and/or execute respective steps ofthe living body detection method according to an embodiment of thepresent disclosure, when being run on the processor 71.

Specifically, when the computer program instructions 73 are run by theprocessor 71, the following steps are executed: capturing a plurality ofimages of a face of an object to be detected when being irradiated byeach of at least two light sources arranged in different positions;calculating a difference image between the plurality of images; andobtaining a detection value of the difference image, and determiningthat the object to be detected is a living body if the detection valueis larger than a predetermined threshold.

Respective modules in the living body detection system according to anembodiment of the present disclosure may be implemented by that theprocessor in the living body detection system according to an embodimentof the present disclosure run the computer program instructions storedin the memory, or may be implemented by that the computer programinstructions stored in the computer-readable storage medium of thecomputer program product according to an embodiment of the presentdisclosure are run by a computer.

The computer-readable storage medium may be any combination of one ormore computer-readable storage mediums, e.g., a computer-readablestorage medium containing computer-readable program codes for randomlygenerating action instruction sequences, another computer-readablestorage medium containing computer-readable program codes for carryingout authentication on face activities.

The computer-readable storage medium may for example include a memorycard of a smart phone, a storage unit of a tablet computer, a hard diskof a personal computer, a random access memory (RAM), a read only memory(ROM), an erasable programmable read-only memory (EPROM), a portablecompact disc read-only memory (CD-ROM), a USB memory, or a combinationof any the aforesaid storage mediums.

Exemplary embodiments of the present disclosure as described in detailin the above are merely illustrative, rather than limitative. However,those skilled in the art should understand that, various modifications,combinations or sub-combinations may be made to these embodimentswithout departing from the principles and spirits of the presentdisclosure, and such modifications are intended to fall within the scopeof the present disclosure.

What is claimed is:
 1. A living body detection method, comprising:irradiating a face of an object to be detected using each of at leasttwo light sources arranged in different positions, respectively;capturing a plurality of images of the face of the object to be detectedwhen being irradiated by each of the light sources; calculating adifference image between the plurality of images; and obtaining adetection value of the difference image, and determining that the objectto be detected is a living body when the detection value is larger thana predetermined threshold: wherein obtaining the detection value of thedifference image, and determining that the object to be detected is theliving body when the detection value is larger than the predeterminedthreshold comprises: determining a facial region from among theplurality of images based on a first image or a second image; extractinga value of the difference image corresponding to the facial region as animage to be detected; obtaining the detection value based on the imageto be detected; and comparing the detection value with the predeterminedthreshold, and determining that the object to be detected is the livingbody when the detection value is larger than the predeterminedthreshold; wherein obtaining the detection value based on the image tobe detected comprises: inputting the image to be detected into apre-trained image classifier, generating and outputting, by the imageclassifier, the detection value corresponding to the image to bedetected.
 2. The living body detection method as claimed in claim 1,wherein the at least two light sources are a first light source and asecond light source, the plurality of images are a first image whenbeing irradiated by the first light source and a second image when beingirradiated by the second light source, a first pixel value of the firstimage at a pixel dot (x,y) is I1 (x,y), and a second pixel value of thesecond image at a pixel dot (x,y) is I2 (x,y), and calculating adifference image between the plurality of images comprises: calculatinga difference image J(x,y) of the first image and the second image at apixel dot (x,y)J(x,y)=[I1(x,y)−I2(x,y)]/[I ₁(x,y)+I2(x,y)±eps] wherein eps is anon-zero constant.
 3. The living body detection method as claimed inclaim 1, wherein the at least two light sources are a first light sourceand a second light source, the plurality of images are a first imagewhen being irradiated by the first light source, a second image whenbeing irradiated by the second light source, and a third image when notbeing irradiated by any of the at least two light sources, a first pixelvalue of the first image at a pixel dot (x,y) is I1 (x,y), a secondpixel value of the second image at a pixel dot (x,y) is I2 (x,y), and athird pixel value of the third image at a pixel dot (x,y) is I3(x,y),calculating a difference image between the plurality of imagescomprises: calculating a difference image J(x,y) of the first image, thesecond image, and the third image at a pixel dot (x,y),J(x,y)=[I ₁(x,y)−I2(x,y)]/[I1(x,y)+I2(x,y)−I3(x,y)×2+eps] wherein eps isa non-zero constant.
 4. The living body detection method as claimed inclaim 1, wherein the at least two light sources are a first light sourceand a second light source, the plurality of images are a first imagewhen being irradiated by the first light source and a second image whenbeing irradiated by the second light source, a first pixel value of thefirst image at a pixel dot (x,y) is I1 (x,y), and a second pixel valueof the second image at a pixel dot (x,y) is I2 (x,y), and calculating adifference image between the plurality of images comprises: calculatinga difference image J(x,y) of the first image and the second image at apixel dot (x,y),J(x,y)=[I1(x,y)/A(x,y)−I2(x,y)/B(x,y)]/[I1(x,y)/A(x,y)+I2(x,y)/B(x,y)+eps]wherein eps is a non-zero constant, A(x,y) and B(x,y) are pre-setcompensation images.
 5. The living body detection method as claimed inclaim 1, wherein the at least two light sources are a first light sourceand a second light source, the plurality of images are a first imagewhen being irradiated by the first light source, a second image whenbeing irradiated by the second light source, and a third image when notbeing irradiated by any of the at least two light sources, a first pixelvalue of the first image at a pixel dot (x,y) is I1 (x,y), a secondpixel value of the second image at a pixel dot (x,y) is I2 (x,y), and athird pixel value of the third image at a pixel dot (x,y) is I3(x,y),calculating a difference image between the plurality of imagescomprises: calculating a difference image J(x,y) of the first image, thesecond image, and the third image at a pixel dot (x,y),J(x,y)=[(I1(x,y)−I3(x,y))/A(x,y)−I2(x,y)−I3(x,y))/B(x,y)]/[(I1(x,y)−I3(x,y))/A(x,y)+(I2(x,y)−I3(x,y))/B(x,y)+eps]wherein eps is a non-zero constant, A(x,y) and B(x,y) are pre-setcompensation images.
 6. A living body detection system, comprising: alight source module including at least two light sources arranged indifferent positions, a face of an object to be detected beingilluminated by each of the at least two light sources, respectively; animage capturing module for capturing a plurality of images of the faceof the object to be detected when being irradiated by each of the lightsources; a living body detection module for determining whether theobject to be detected is a living body, wherein a method of determiningwhether the object to be detected is living comprises: calculating adifference image between the plurality of images; and obtaining adetection value of the difference image, and determining that the objectto be detected is a living body when the detection value is larger thana predetermined threshold, wherein the living body detection moduledetermines a facial region from among the plurality of images based onthe a first image or the a second image, extracts a value of thedifference image corresponding to the facial region as an image to bedetected, obtains the detection value based on the image to be detected,compares the detection value with the predetermined threshold, anddetermines that the object to be detected is the living body when thedetection value is larger than the predetermined threshold; wherein theliving body detection module further comprises a pre-trained imageclassifier that generates and outputs the detection value correspondingto the image to be detected.
 7. The living body detection system asclaimed in claim 6, wherein the at least two light sources are a firstlight source and a second light source, the plurality of images are afirst image when being irradiated by the first light source and a secondimage when being irradiated by the second light source, a first pixelvalue of the first image at a pixel dot (x,y) is I1 (x,y), and a secondpixel value of the second image at a pixel dot (x,y) is I2 (x,y), theliving body detection module calculates a difference image J(x,y) of thefirst image and the second image at a pixel dot (x,y)J(x,y)=[I1(x,y)−I2(x,y)]/[I1(x,y)+I2(x,y)+eps] wherein eps is a non-zeroconstant.
 8. The living body detection system as claimed in claim 6,wherein the at least two light sources are a first light source and asecond light source, the plurality of images are a first image whenbeing irradiated by the first light source, a second image when beingirradiated by the second light source, and a third image when not beingirradiated by any of the at least two light sources, a first pixel valueof the first image at a pixel dot (x,y) is I1 (x,y), a second pixelvalue of the second image at a pixel dot (x,y) is I2 (x,y), and a thirdpixel value of the third image at a pixel dot (x,y) is I3(x,y),calculating a difference image between the plurality of imagescomprises: the living body detection module calculates a differenceimage J(x,y) of the first image, the second image, and the third imageat a pixel dot (x,y),J(x,y)=[(x,y)−I2(x,y)]/[(x,y)+I2(x,y)−I3(x,y)x2+eps] wherein eps is anon-zero constant.
 9. The living body detection system as claimed inclaim 6, wherein the at least two light sources are a first light sourceand a second light source, the plurality of images are a first imagewhen being irradiated by the first light source and a second image whenbeing irradiated by the second light source, a first pixel value of thefirst image at a pixel dot (x,y) is I1 (x,y), and a second pixel valueof the second image at a pixel dot (x,y) is I2 (x,y), and calculating adifference image between the plurality of images comprises: the livingbody detection module calculates a difference image J(x,y) of the firstimage and the second image at a pixel dot (x,y),J(x,y)=[I1(x,y)/A(x,y)−I2(x,y)/B(x,y)]/[I1(x,y)/A(x,y)+I2(x,y)/B(x,y)+eps]wherein eps is a non-zero constant, A(x,y) and B(x,y) are pre-setcompensation images.
 10. The living body detection system as claimed inclaim 6, wherein the at least two light sources are a first light sourceand a second light source, the plurality of images are a first imagewhen being irradiated by the first light source, a second image whenbeing irradiated by the second light source, and a third image when notbeing irradiated by any of the at least two light sources, a first pixelvalue of the first image at a pixel dot (x,y) is I1 (x,y), a secondpixel value of the second image at a pixel dot (x,y) is I2 (x,y), and athird pixel value of the third image at a pixel dot (x,y) is I3(x,y),calculating a difference image between the plurality of imagescomprises: the living body detection module calculates a differenceimage J(x,y) of the first image, the second image, and the third imageat a pixel dot (x,y),J(x,y)=[(I1(x,y)−I3(x,y))/A(x,y)−I2(x,y)−I3(x,y))/B(x,y)]/[(I1(x,y)−I3(x,y))/A(x,y)+(I2(x,y)−I3(x,y))/B(x,y)+eps]wherein eps is a non-zero constant, A(x,y) and B(x,y) are pre-setcompensation images.
 11. The living body detection system as claimed inclaim 6, wherein the at least two light sources are programmable lightsources disposed at periphery of the image capturing module andintegrally constructed together with the image capturing module.
 12. Theliving body detection system as claimed in claim 11, wherein the atleast two light sources are disposed symmetrically with respect to theimage capturing module.
 13. A non-transitory computer-readable medium onwhich computer program instructions configured to execute the followingsteps when being run by a computer are stored: capturing a plurality ofimages of a face of an object to be detected when being irradiated byeach of at least two light sources arranged in different positions;calculating a difference image between the plurality of images; andobtaining a detection value of the difference image, and determiningthat the object to be detected is a living body when the detection valueis larger than a predetermined threshold, wherein obtaining thedetection value of the difference image, and determining that the objectto be detected is the living body when the detection value is largerthan the predetermined threshold comprises: determining a facial regionfrom among the plurality of images based on a first image or a secondimage; extracting a value of the difference image corresponding to thefacial region as an image to be detected; obtaining the detection valuebased on the image to be detected; and comparing the detection valuewith the predetermined threshold, and determining that the object to bedetected is the living body when the detection value is larger than thepredetermined threshold; wherein obtaining the detection value based onthe image to be detected comprises: inputting the image to be detectedinto a pre-trained image classifier, generating and outputting, by theimage classifier, the detection value corresponding to the image to bedetected.